package start.doubudouyin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jakarta.annotation.Resource;
import start.doubudouyin.entity.Videolike;
import start.doubudouyin.service.VideolikeService;
import start.doubudouyin.mapper.VideolikeMapper;
import org.springframework.stereotype.Service;

/**
 * @author mmmm
 * @description 针对表【videolike(视频点赞表)】的数据库操作Service实现
 * @createDate 2025-06-09 14:26:29
 */
@Service
public class VideolikeServiceImpl extends ServiceImpl<VideolikeMapper, Videolike>
        implements VideolikeService {

    @Resource
    private VideolikeMapper videolikeMapper;

    @Override
    public boolean addLike(String userId, String videoId) {
        return videolikeMapper.insertLike(userId, videoId) > 0;
    }
    public Boolean isLiked(String userId,String videoId){
        return videolikeMapper.isLiked(userId, videoId);
    }

    public Integer recordLike(String userId,String videoId){
        return videolikeMapper.recordLike(userId,videoId);
    }
    public Integer deleteLike(String userId,String videoId){
        return videolikeMapper.deleteLike(userId,videoId);
    }
    public Integer delRecordLike(String userId,String videoId){
        return videolikeMapper.delRecordLike(userId,videoId);
    }
}




